<template>
	<view class="container">
		<view class="title">IP图鉴</view>
		<view class="list">
			<view class="item" v-for="item in list" @click="toIndex(item.id,item.title)">
				<view class="t">{{item.title}}</view>
				<view class="border">
					<image class="img" :src="item.thumb" mode="aspectFill"></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[]
			}
		},
		computed: {
		},
		watch: {
		},
		onLoad() {
			this.getIp();
		},
		methods: {
			toIndex(id,title){
				uni.navigateTo({
					url:'/pages/collection/index?id='+id+'&title='+title
				})
			},
			getIp(){
				this.$http('/ip/categories', 'GET', {
					per_page: 500
				}).then(res => {
					this.list = res.data.list;
				})
			}
		}
	}
</script>

<style lang="scss">
	page{
		background: linear-gradient(#adb7ba, #fff);
		// background: #adb7ba;
	}
	.title{
		font-family: alimama;
		padding: 35rpx 30rpx 20rpx 30rpx;
	}
	.list{
		padding: 0rpx 30rpx;
		font-family: alimama;
		display: flex;
		// justify-content: space-around;
		flex-wrap: wrap;
		box-sizing: border-box;
		padding-bottom: 30rpx;
		.item{
			width: 160rpx;
			padding: 15rpx;
			background-color: #fff;
			border-radius: 10rpx;
			height: 200rpx;
			box-sizing: border-box;
			margin-top: 15rpx;
			margin-right: 19rpx;
			.t{
				font-size: 24rpx;
				overflow: hidden;
				text-overflow: ellipsis;
				display: -webkit-box;
				-webkit-line-clamp: 1;
				-webkit-box-orient: vertical;
				width: 120rpx;
				margin-top: 5rpx;
			}
			.border{
				margin-top: 15rpx;
				border: 2px solid #898989;
				width: 125rpx;
				height: 125rpx;
				border-radius: 100rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				.img{
					width: 120rpx;
					height: 120rpx;
					border-radius: 100rpx;
				}
			}
			
		}
		.item:nth-child(4n){
			margin-right: 0rpx;
		}
	}
</style>
